home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / softwareupdate / system / amigados / amigadoslibrary / fputc.c < prev    next >
C/C++ Source or Header  |  1996-10-10  |  783b  |  43 lines

  1. /* FPutC.c   V1.1   93-03-03                   */
  2. /* ROM library: "dos.library/FPutC", (V36+)    */
  3. /* Copyright 1993, Anders Bjerin, Amiga C Club */
  4.  
  5.  
  6. #include <dos/dos.h>
  7.  
  8. #include <clib/dos_protos.h>
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11.  
  12. #define CHAR_J 74
  13.  
  14. UBYTE *version = "$VER: FPutC 1.1";
  15.  
  16. int main( int argc, char *argv[] );
  17. int main( int argc, char *argv[] )
  18. {
  19.   BPTR my_file;
  20.   int error_code;
  21.  
  22.  
  23.   /* Open a new file: */
  24.   my_file = Open( "RAM:Important.dat", MODE_NEWFILE );
  25.   if( !my_file )
  26.     exit( 20 );
  27.  
  28.   /* Store one character: */
  29.   error_code = FPutC( my_file, CHAR_J );
  30.  
  31.   /* OK? */
  32.   if( error_code == -1 )
  33.     printf( "Could not save the character!\n" );
  34.   else
  35.     printf( "The character was successsfully saved!\n" );
  36.  
  37.   Close( my_file );
  38.  
  39.   exit( 0 );
  40. }
  41.  
  42.  
  43.